﻿package mortal.game.view.skill.panel.render
{
    import com.mui.controls.*;
    import com.mui.utils.*;
    import mortal.common.*;
    import mortal.game.cache.*;
    import mortal.game.view.skill.*;
    import mortal.game.view.skill.panel.data.*;

    public class SkillRuneSmall extends GSprite
    {
        private var _runes:Array;
        private var _num:int;

        public function SkillRuneSmall()
        {
            return;
        }// end function

        public function updateSkillInfo(param1:SkillInfo) : void
        {
            var _loc_4:SkillRuneSmallItem = null;
            var _loc_5:RuneItemData = null;
            var _loc_2:* = Cache.instance.skill.getRunesBySerial(param1.tSkill.series);
            this._num = 0;
            var _loc_3:int = 0;
            while (_loc_3 < 4)
            {
                
                _loc_4 = this._runes[_loc_3];
                _loc_5 = _loc_2[_loc_3];
                if (_loc_5 == null)
                {
                    _loc_4.visible = false;
                }
                else
                {
                    _loc_4.visible = true;
                    var _loc_6:String = this;
                    var _loc_7:* = this._num + 1;
                    _loc_6._num = _loc_7;
                    _loc_4.runeData = _loc_5;
                }
                _loc_3++;
            }
            return;
        }// end function

        override public function get width() : Number
        {
            return this._num * 24;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            var _loc_2:SkillRuneSmallItem = null;
            super.createDisposedChildrenImpl();
            this.mouseChildren = true;
            this.mouseEnabled = true;
            this._runes = [];
            var _loc_1:int = 0;
            while (_loc_1 < 4)
            {
                
                _loc_2 = UICompomentPool.getUICompoment(SkillRuneSmallItem);
                this._runes.push(_loc_2);
                _loc_2.x = _loc_1 * 24;
                this.addChild(_loc_2);
                _loc_1++;
            }
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl(param1);
            DisplayUtil.delNotUse(this._runes, 0);
            this._runes = null;
            return;
        }// end function

    }
}
